package itsm.isperp.module.service.change;

import java.util.List;
import java.util.Map;

import itsm.isperp.framework.service.BaseService;
import itsm.isperp.module.entity.change.ChgChangeConfiguration;
import itsm.isperp.module.repository.change.ChgChangeConfigurationMapper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

/**
 * 服务
 * 
 * @author lizx
 * @date 2015-04-27 15:18
 */
@Service
public class ChgChangeConfigurationService extends
		BaseService<ChgChangeConfiguration> {

	@Autowired
	protected ChgChangeConfigurationMapper chgChangeConfigurationMapper;
	
	@Autowired
	protected JdbcTemplate jdbcTemplate;

	@Override
	public ChgChangeConfigurationMapper getRepository() {
		return this.chgChangeConfigurationMapper;
	}

	public void deleteChangeConfCi(String changeId, String ciId,
			String columnkey) {
		chgChangeConfigurationMapper.deleteChangeConfCi(changeId, ciId,
				columnkey);

	}
	public List<Map<String, Object>> getPlanChangeCiValueByChangeId(String changeId, String ciId) {
		String sql = "select * from chg_change_configuration where change_id='" + changeId + "' and ci_Id='" + ciId + "'";
		return jdbcTemplate.queryForList(sql);

	}

}
